﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Code.Models;
using Code.Commen;

namespace Code.BLL
{
    public class PlayTypeManage:ManageBase<PlayType>
    {
        /// <summary>
        /// 获取指定彩种，指定奖金模式的奖金
        /// </summary>
        /// <param name="lotteryId">彩种</param>
        /// <param name="winMoneyModelId">奖金模式</param>
        /// <returns></returns>
        public Dictionary<int,decimal> GetWinMoney(LotteryType lotteryId, int winMoneyModelId)
        {
            return base.Select(s => s.Where(p => p.LotteryID == (int)lotteryId).Select(p => new {id=p.ID, winMoney=p.PlayTypeOption.FirstOrDefault(p1 => p1.WinMoneyModelID == winMoneyModelId).WinMoney }).ToDictionary(p=>p.id,p=>p.winMoney));
        }




    }
}
